package com.woniuxy.personal.core.controller;


import com.woniuxy.common.CommonResult;

import com.woniuxy.personal.core.model.PlAddress;
import com.woniuxy.personal.core.service.PlAddressService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-06-29
 */
@Api(tags = "地址相关接口")
@RestController
@RequestMapping("/address")
public class PlAddressController {

    @Autowired
    PlAddressService plAddressService;

    /**
     * Description : 地址  <br/>
     * ChangeLog : 1. 创建 (2021/6/30 19:41 [binhu]);
     * @param userId
     * @return com.woniuxy.common.CommonResult<java.util.List<com.woniuxy.personal.core.model.PlAddress>>
    */
    @ApiOperation(value = "地址")
    @GetMapping("/selectAll")
    public CommonResult<List<PlAddress>> selectAll(Integer userId){
        List<PlAddress> addresses = plAddressService.selectAll(userId);
        return CommonResult.success(addresses);
    }

}

